/**
* @file frm_mange.h
* @brief Header file for frm_mange.c
* @author xy
* @version 1.0
* @date 2024-11-12
*/

#ifndef FRAM_MANGE_H
#define FRAM_MANGE_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

#ifndef NULL
#define NULL 0
#endif

/* FRAM数据结构 */
/* unsigned int addrstart; 保存结构开始位置 */
/* unsigned int datlen; 数据大小 */
/* unsigned int backupvaluable; 是否有备份数据 */
/* unsigned int backupinfolen; 备份信息大小 */

struct FRAM_DATA_INFO_S
{
    unsigned int addrstart;
    unsigned int datlen;
    unsigned int backupvaluable;
    unsigned int backupinfolen;
};

int framwrite(struct FRAM_DATA_INFO_S *framinfo, unsigned int addr, unsigned char *data, unsigned int len);

int framread(struct FRAM_DATA_INFO_S *framinfo, unsigned int addr, unsigned char *data, unsigned int len);

#ifdef __cplusplus
}
#endif

#endif //FRAM_MANGE_H
